#include "cnblogs.h"

CnBlogs::CnBlogs(Type type) : m_type(type)
{

}

QString CnBlogs::name()
{
    switch (m_type) {
    case News:
        return "博客园 - 新闻";
    case Blog:
        return "博客园 - 博客";
    case Question:
        return "博客园 - 博问";
    case Kb:
        return "博客园 - 知识库";
    }

    return "";
}

QString CnBlogs::content(const QString &text)
{
    QString prefix = "";
    switch (m_type) {
    case News:
        prefix = "https://zzk.cnblogs.com/s/news?Keywords=";
    case Blog:
        prefix = "https://zzk.cnblogs.com/s/blogpost?Keywords=";
        break;
    case Question:
        prefix = "https://zzk.cnblogs.com/s/blogpost?Keywords=";
        break;
    case Kb:
        prefix = "https://zzk.cnblogs.com/s/blogpost?Keywords=";
        break;
    }
    return prefix + text;
}
